package cc.zstart.generator.mybatis.util;

import java.io.IOException;
import java.io.InputStream;

import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

/**
 * @desc <p></p>
 * @author DaiJiangGuo
 * @date 2015年5月15日下午6:59:29
 */
public class MapperEntityResolver implements EntityResolver {

    /**
     *
     */
    public MapperEntityResolver() {
        super();
    }

    /* (non-Javadoc)
     * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String)
     */
    @Override
    public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
        InputStream is = getClass().getClassLoader().getResourceAsStream("cc/zstart/generator/mybatis/util/mybatis-3-mapper.dtd");
        InputSource ins = new InputSource(is);
        return ins;
    }

}
